package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.WalletDescEntity
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.WalletDescView

class WalletDescPresenter(view: WalletDescView):BasePresenter<WalletDescView>(view){


    fun getWalletDesc(start: String, end: String, pageNo: Int) {
        val accessToken = SPUtils.getString(Constant.AccessToken)
        val walletDesc = Model.getServer()
            .getWalletDesc(accessToken = accessToken, start = start, end = end, pageNo = pageNo)
        Model.getObservable(walletDesc,object :CustomObserver<WalletDescEntity>(mvpView){

            override fun success(t: WalletDescEntity) {
                mvpView?.dataSuccess(t.data)
            }
        })
    }


}